package com.fz.wms.canvas;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.Rect;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.LinearLayout;

public class cust_view extends LinearLayout {
    private Path mPath;
    private int mRadio;
    public cust_view(Context context) {
        super(context);
        init();
    }

    public cust_view(Context context, AttributeSet attr) {
        super(context,attr);
        init();
    }

    public void init (){
        mPath=new Path();
        mRadio=50;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        RectF rectf=new RectF(0,0,getWidth(),getHeight());
        mPath.addRoundRect(rectf,
                mRadio,
                mRadio,
                Path.Direction.CW);
        canvas.clipPath(mPath);
        super.onDraw(canvas);

    }
}
